{include file="common/header"/}
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-row">
                        <form action="" class="layui-form">
                            <div class="layui-row layui-col-space10">
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="text" name="" id="keys" lay-verify="required" placeholder="请输入" class="layui-input">
                              </div>
                              <div class="layui-col-md2 layui-col-xs4">
                                <input type="button" id="searchBtn" name="submit" class="layui-btn" value="搜索">
                              </div>
                            </div>
                        </form>
                    </div>
                    <div class="layui-row">
                        <table class="layui-table layui-hide" id="list" lay-filter="list"></table>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>

<script type="text/html" id="toolbarDemo">
    <div class="layui-btn-group">
        <a href="javascript:;" class="layui-btn layui-btn-warm layui-btn-sm" onclick="xadmin.open('{:lang('add')}{:lang('config')}','{:url('configAdd')}');"><i class="layui-icon layui-icon-add-circle"></i>{:lang('add')}{:lang('config')}</a>
        <!-- <a href="javascript:;"  class="layui-btn layui-btn-sm layui-btn-danger" onclick="xadmin.open('{:lang('add')}{:lang('config group')}','{:url('configGroupAdd')}');" >{:lang('add')}{:lang('config group')}</a>
        <a href="javascript:;"  class="layui-btn layui-btn-sm layui-btn-normal" onclick="xadmin.open('{:lang('config group')}{:lang('list')}','{:url('configGroup')}');">{:lang('config group')}{:lang('list')}</a> -->
    </div>
    
</script>

<script type="text/html" id="action">
    <div class="layui-btn-group">
        <a  class="layui-btn  layui-btn-xs" lay-event="edit" onclick="xadmin.open('{:lang('edit')}','{:url('configEdit')}?id={{d.id}}')">{:lang('edit')}</a>
        <a  class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" data-href="{:url('configDel')}?id={{d.id}}">{:lang('del')}</a>
    </div>
</script>
<script type="text/html" id="status">
    <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" data-href="{:url('configState')}" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
</script>


{include file="common/footer"/}
<script>
var table;
layui.use(['form', 'table'], function () {
    table = layui.table;
    table.render({
        elem: '#list',
        url: '{:url("configlist")}',
        method: 'post',
        toolbar: '#toolbarDemo',

        defaultToolbar: [],
        cols: [[
            {checkbox: true, fixed: true},
            {field: 'id', title: 'ID', sort: true},
            {field: 'name', title: '配置键'},
            {field: 'title', title: '配置名称'},
            {field: 'value', title: '配置值'},
            {field: 'group', title: '分组'},
            {field: 'tip', title: '备注'},
            {field: 'type', title: '类型'},
            {title:'操作',toolbar: '#action',align:"center"}
        ]],
        limits: [10, 15, 20, 25, 50, 100],
        limit: 15,
        page: true
    });
  $('#searchBtn').click(function(){
    searchObj['keys'] = $('#keys').val();
    table.reload('tableReload',{where:searchObj});
  }) 
});


</script>